<?php
class baseAction extends Action{
	/**
	 * 显示验证码
	 */
	Public function verify(){
		import("@.ORG.Util.Image");
		//Image::buildImageVerify();
		Image::buildImageVerify ( 5, 5, "gif" );
	}
	
	/**
	 * 获取当前购物车商品的数量
	 */
	function getcartnum()
	{
		$syscookie=unserialize($_COOKIE["syscookie"]);
		
		echo count($syscookie["cart"]);
		
	}
	
	/**
	 * 页面上部搜索框
	 */
	function search()
	{
		$this->display();
	}
	
	/*
	 * 供ajax方式调用，并获取cookie值
	 */
	function ajaxgetcookie()
	{
		
		$c1=$_REQUEST["c1"];//第一级名称
		$c2=$_REQUEST["c2"];//第二级名称
		$c3=$_REQUEST["c3"];//第三级名称
		$c4=$_REQUEST["c4"];
		$syscookie=unserialize($_COOKIE["syscookie"]);
		
		if($c1!="" and $c2=="" and $c3=="" and $c4=="" ) echo $syscookie[$c1];
		if($c1!="" and $c2!="" and $c3=="" and $c4=="" ) echo $syscookie[$c1][$c2];
		if($c1!="" and $c2!="" and $c3!="" and $c4=="" ) echo $syscookie[$c1][$c2][$c3];
		if($c1!="" and $c2!="" and $c3!="" and $c4!="" ) echo $syscookie[$c1][$c2][$c3][$c4];
		
		
		
		
	}
	
}


?>